import { createRouter, createWebHistory } from 'vue-router';
import Login from '@/views/Login.vue';
import AdminDashboard from '@/views/admin/AdminDashboard.vue';
import UserManagement from '@/views/admin/UserManagement.vue';
import MusicManagement from '@/views/admin/MusicManagement.vue';
import SystemLogs from '@/views/admin/SystemLogs.vue';
import BandDashboard from '@/views/band/BandDashboard.vue';
import BandInfo from '@/views/band/BandInfo.vue';
import BandMember from '@/views/band/BandMember.vue';
import BandMusic from '@/views/band/BandMusic.vue';
import BandConcert from '@/views/band/BandConcert.vue';
import BandAlbum from '@/views/band/BandAlbum.vue';
import BandEvaluation from '@/views/band/BandEvaluation.vue';
import FanDashboard from '@/views/fan/FanDashboard.vue';
import FanInfo from '@/views/fan/FanInfo.vue';
import FanFavorites from '@/views/fan/FanFavorites.vue';
import FanComments from '@/views/fan/FanComments.vue';
import FanBand from '@/views/fan/FanBand.vue';
import FanGenre from '@/views/fan/FanGenre.vue';
import FanConcerts from '@/views/fan/FanConcerts.vue';
import FanOverview from '@/views/fan/FanOverview.vue';
import FanAlbumOverview from '@/views/fan/FanAlbumOverview.vue';
import FanSongOverview from '@/views/fan/FanSongOverview.vue';
import FanConcertOverview from '@/views/fan/FanConcertOverview.vue';
import FanInfoMaintenance from '@/views/fan/FanInfoMaintenance.vue';

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/admin',
    name: 'AdminDashboard',
    component: AdminDashboard,
    redirect: '/admin/users',
    children: [
      {
        path: 'users',
        name: 'UserManagement',
        component: UserManagement
      },
      {
        path: 'music',
        name: 'MusicManagement',
        component: MusicManagement
      },
      {
        path: 'logs',
        name: 'SystemLogs',
        component: SystemLogs
      }
    ]
  },
  {
    path: '/band',
    name: 'BandDashboard',
    component: BandDashboard,
    redirect: '/band/info',
    children: [
      {
        path: 'info',
        name: 'BandInfo',
        component: BandInfo
      },
      {
        path: 'member',
        name: 'BandMember',
        component: BandMember
      },
      {
        path: 'music',
        name: 'BandMusic',
        component: BandMusic
      },
      {
        path: 'concert',
        name: 'BandConcert',
        component: BandConcert
      },
      {
        path: 'album',
        name: 'BandAlbum',
        component: BandAlbum
      },
      {
        path: 'evaluation',
        name: 'BandEvaluation',
        component: BandEvaluation
      }
    ]
  },
  {
    path: '/fan',
    name: 'FanDashboard',
    component: FanDashboard,
    redirect: '/fan/info',
    children: [
      {
        path: 'info',
        name: 'FanInfo',
        component: FanInfo
      },
      {
        path: 'favorites',
        name: 'FanFavorites',
        component: FanFavorites
      },
      {
        path: 'comments',
        name: 'FanComments',
        component: FanComments
      },
      {
        path: 'band',
        name: 'FanBand',
        component: FanBand
      },
      {
        path: 'genre',
        name: 'FanGenre',
        component: FanGenre
      },
      {
        path: 'concerts',
        name: 'FanConcerts',
        component: FanConcerts
      },
      {
        path: 'overview',
        name: 'FanOverview',
        component: FanOverview
      },
      {
        path: 'album-overview',
        name: 'FanAlbumOverview',
        component: FanAlbumOverview
      },
      {
        path: 'song-overview',
        name: 'FanSongOverview',
        component: FanSongOverview
      },
      {
        path: 'concert-overview',
        name: 'FanConcertOverview',
        component: FanConcertOverview
      },
      {
        path: 'info-maintenance',
        name: 'FanInfoMaintenance',
        component: FanInfoMaintenance
      }
    ]
  }
];

const router = createRouter({
  history: createWebHistory(),
  routes
});

export default router; 